package com.eastcom.dataquality.ds.wapper;

import com.eastcom.dataquality.core.module.Atom_DatasetDefine;
import com.eastcom.dataquality.core.util.DataSetKit;
import com.eastcom.dataquality.core.util.MessageCreator;
import com.eastcom.dataquality.core.util.db.ResultData;
import com.eastcom.dataquality.core.util.db.ResultDataSwapper;

public class XmlResultDataSwapper implements ResultDataSwapper<String> {

	public String swap(ResultData smoothData, Object... objects) {
		String smoothXml=null;
		Atom_DatasetDefine dataset_define=(Atom_DatasetDefine)objects[0];
		String[][] arrayResult=DataSetKit.getResultDataAsArray(smoothData);
		if(arrayResult!=null&&arrayResult.length>1){
			smoothXml= MessageCreator.makeMessage(arrayResult, dataset_define.getId());
		}
		return smoothXml;
	}
}
